package com.wyb.springcloud.demo.streamhello.stream;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.MessageChannel;

@EnableBinding(Source.class)
public class SinkSender {

    @Autowired
    @Output(Source.OUTPUT)
    private MessageChannel channel;

    public void send(String msg) {
        channel.send(MessageBuilder.withPayload(msg).build());
    }
}
